written in 2018 for Astromechs Robotics & the Kansas City Robotics Foundation.
Programming Documentation - Control Award
The Control Award is a competitive FIRST Tech Challenge award given to the team with the most impressive algorithms used for their robot, as determined by a panel of volunteer judges. To apply for the award, teams must document their goals for the robot game's thirty-second 'Autonomous' period, the sensors their robot uses, the key algorithms that drive their robot's function, and any enhancements programmed to assist drivers during the two-minute remote-controlled portion of the game.
As a team member of FTC #3409 Astromechs, I was one of three programmers, and I was responsible for most documentation written about our code. These applications showcase my ability to translate highly technical information into phraseage a layperson can understand, while also providing satisfactory detail for a professional audience. Mentions of 'jewels,' 'pedestals,' 'glyphs' and 'pictographs' reference elements of the robot challenge while 'glyphter,' 'turbo encabulator,' 'arms' and the 'scoop' are various mechanisms of my team's competition robot.
Application Text
Autonomous Objectives: Knock the correct jewel off of the pedestal, and score one or more glyphs into the column that’s encoded in the pictograph. Finish autonomous by parking in the safe zone.
Sensors Used:
- Nexus 5 built-in gyroscope accessed through the GameRotationVector for Android. Used to turn to accurate and consistent angles, and drive in a consistently straight line.
- Nexus 5 built-in accelerometer accessed through the GameRotationVector for Android. Used to minimize gyro drift in the Nexus 5 built-in gyroscope.
- Nexus 5 built-in camera. Used to run Vuforia to read the pictographs, and to determine the orientation of the jewels.
- Encoders installed on each drive motor, the lifter motor, and motor for the turbo encabulator (glyphter). Used to keep drive distances consistent and maintain position control on the lifter.
Key Algorithms:
- vision() - Identifies pictograph using Vuforia, and correctly identifies the color of the visible jewel, then extrapolates from the jewel it can see to determine the orientation of the entire jewel pedestal. Includes an option to save the picture to the phone for further analysis.
- driveStraight() - Drives forward for a given number of inches at a given heading, using encoders to determine distance, and gyroscope and accelerometer correction to ensure we drive in a straight line/towards our given heading. In addition, utilizes the proportional component of PID control to ensure we don’t overshoot our target (using encoder values) and that we drive in a straight line (using gyro values). Also incorporates a custom exception, TimeoutException, for cases where we want a drive to time out if it takes too long.
- turn() - Turns around the center of the robot to a given heading, using gyroscope and accelerometer correction.
- strafe() - Strafes using our Mecanum wheels for a given number of inches at a given heading, using encoders to determine distance, and gyroscope and accelerometer correction to ensure we drive in a straight line/towards our given heading. In addition, utilizes the proportional component of PID control to ensure that we strafe in a straight line (using gyro values).
Driver-Controlled Enhancements:
- Control spread across two gamepads to optimize control for a drive team of one driver and one operator.
- Scales power of motors proportional to one another to make strafing around one point possible.
- Each grabber arm moves independently to allow for more precise manipulation of the glyphs.
- Allows the operator to move the scoop to any position manually and when they let go, the scoop will remain in the last known position (i.e., where the operator left it,) utilizing the proportional component of PID control.
- Code for the ‘hand’ and ‘elbow’ is on a toggle to make control more intuitive for the operator and to condense controls.
- Both bumpers on the driver’s gamepad must be pressed to activate slow-driving mode. This reduces the incidence of accidentally activating slow mode.